pgf_ckill_omc_r_up1 =  (pgf_ckill_up1/updated_pop)*100000,
pgf_cmass_omc_r_up1 =  (pgf_cmass_up1/updated_pop)*100000,
pgf_dv_omc_r_up1 =  (pgf_dv_up1/updated_pop)*100000)
mil_cv <- mil_cv %>%
relocate(divipola, year,
bd_st_rg_omc_up1.2, conf_events_omc_r_up1, pgf_ckill_omc_r_up1, pgf_cmass_omc_r_up1, pgf_dv_omc_r_up1)
write_xlsx(mil_cv, "Ortega(2024)-CV-MilitaryVariables_Updated(09282024).xlsx")
cv <- left_join(cv, mil_cv)
rm(cv)
cv <- read_xlsx("Ortega(2024)-CV_FV(09022024).xlsx")
cv3 <- left_join(cv, mil_cv, by = c("divipola", "year"))
recruit <- read_csv("verdata-reclutamiento-R1.csv")
recruit_reb <- recruit %>%
rename(divipola = muni_code_hecho,
year = yy_hecho) %>%
filter(p_str == "GUE-FARC" | p_str == "GUE-ELN" | p_str == "GUE-OTRO")
dane_ru <- recruit_reb %>%
group_by(divipola, year) %>%
summarise(reb_ru = n())
m_data_f3b <- left_join(rcs_data, dane_ru) # The data on recruitment covers the period from 1990 to 2005. Thus, I replace NA by 0 in this period and filter the data since 1990. Before that period, the data can still have NAs
rcs_data <- read_xlsx("TSCS-Colombia(1964-2005).xlsx") ### -> This is the template.
m_data_f3b <- left_join(rcs_data, dane_ru) # The data on recruitment covers the period from 1990 to 2005. Thus, I replace NA by 0 in this period and filter the data since 1990. Before that period, the data can still have NAs
m_data_f3b <- m_data_f3b %>%
filter(year > 1989)
m_data_f3b <- m_data_f3b %>% replace_na(list(reb_ru = 0))
m_data_f3b <- m_data_f3b %>%
dplyr::select(year, divipola, reb_ru)
View(m_data_f3b)
cv <- cv %>%
select(-reb_ru, -reb_ru2, -reb_ru_r)
cv2 <- left_join(cv, m_data_f3b)
View(cv2)
cv <- left_join(cv, m_data_f3b)
cv <- cv %>%
mutate(reb_ru2 = case_when(
reb_ru == 0 ~ 0,
reb_ru > 0 ~ 1
))
cv <- cv %>%
mutate(reb_ru_r = (reb_ru/updated_pop) * 100000)
cv <- cv %>%
dplyr::group_by(year) %>%
mutate(median_reb_ru_r = median(reb_ru_r, na.rm = T)) %>%
dplyr::ungroup() # The median recruitment is 0. It seems that is not useful to control for rates
cv <- cv %>%
rename(cv5c.1.bd_o = bd_st_rg_omc_up1.2, # Military Dispute
cv6b.1.ce_o_r = conf_events_omc_r_up1, # Conflict Events // Updated
cv7b.1.pgf_ck_o_r = pgf_ckill_omc_r_up1, # Civilian Assassinations & Massacres by PGF
cv7b.2.pgf_cm_o_r = pgf_cmass_omc_r_up1,
cv7b.3.pgf_cd_o_r = pgf_dv_omc_r_up1)
View(cv)
cv <- left_join(cv, mil_cv, by = c("divipola", "year"))
cv <- cv %>%
rename(cv5c.1.bd_o = bd_st_rg_omc_up1.2, # Military Dispute
cv6b.1.ce_o_r = conf_events_omc_r_up1, # Conflict Events // Updated
cv7b.1.pgf_ck_o_r = pgf_ckill_omc_r_up1, # Civilian Assassinations & Massacres by PGF
cv7b.2.pgf_cm_o_r = pgf_cmass_omc_r_up1,
cv7b.3.pgf_cd_o_r = pgf_dv_omc_r_up1)
cv <- cv %>%
relocate(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5b.1.bd_o, cv6.1.ce_o_r, cv7.1.pgf_ck_o_r, cv7.2.pgf_cm_o_r, cv7.3.pgf_cd_o_r,
reb_ru, reb_ru2, reb_ru_r,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
View(cv)
cv <- cv %>%
relocate(divipola, year,
cv1.lpop, cv2.rur_p, cv3c.c_lsh1, cv4.nbi,
cv5c.1.bd_o, cv6b.1.ce_o_r, cv7b.1.pgf_ck_o_r, cv7b.2.pgf_cm_o_r, cv7b.3.pgf_cd_o_r,
reb_ru, reb_ru2, reb_ru_r,
median_c_lsh_m, median_c_lsh_c, median_c_lsh_b, median_c_lsh_e)
View(cv)
write_xlsx(cv, "Ortega(2024)-CV_FV-Updated(09282024).xlsx")
library(tidyverse)
library(readstata13)
library(foreign)
library(readxl)
library(writexl)
dv <- read_xlsx("Ortega(2024)-DV_FV-Updated(09162024).xlsx")
iv <- read_xlsx("Ortega(2024)-IV_FV(09022024).xlsx")
cv <- read_xlsx("Ortega(2024)-CV_FV-Updated(09282024).xlsx")
rcs_data <- read_xlsx("TSCS-Colombia(1964-2005).xlsx")
dv$year <- as.integer(dv$year)
dv$divipola <- as.integer(dv$divipola)
iv$year <- as.integer(iv$year)
iv$divipola <- as.integer(iv$divipola)
cv$year <- as.integer(cv$year)
cv$divipola <- as.integer(cv$divipola)
m_data_f <- left_join(rcs_data, dv)
m_data_f <- left_join(m_data_f, iv)
View(iv)
m_data_f <- left_join(m_data_f, cv)
View(rcs_data)
dv <- read_xlsx("Ortega(2024)-DV_FV-Updated(09162024).xlsx")
iv <- read_xlsx("Ortega(2024)-IV_FV(09022024).xlsx")
cv <- read_xlsx("Ortega(2024)-CV_FV-Updated(09282024).xlsx")
rcs_data <- read_xlsx("TSCS-Colombia(1964-2005).xlsx")
rcs_data <- rcs_data %>%
select(divipola, year)
dv$year <- as.integer(dv$year)
dv$divipola <- as.integer(dv$divipola)
iv$year <- as.integer(iv$year)
iv$divipola <- as.integer(iv$divipola)
cv$year <- as.integer(cv$year)
cv$divipola <- as.integer(cv$divipola)
m_data_f <- left_join(rcs_data, dv)
m_data_f <- left_join(m_data_f, iv)
m_data_f <- left_join(m_data_f, cv)
m_data_f <- m_data_f %>%
filter(year > 1984 & year < 2006)
m_data_f <- m_data_f %>%
rename(
reb_ckill_up1 = reb_ckill,
reb_ckill_sv_up1 = reb_ckill_sv,
farc_ckill_up1 = farc_ckill,
farc_ckill_sv_up1 = farc_ckill_sv,
eln_ckill_up1 = eln_ckill,
eln_ckill_sv_up1 = eln_ckill_sv,
reb_cmass_up1 = reb_cmass,
reb_cmass_sv_up1 = reb_cmass_sv,
farc_cmass_up1 = farc_cmass,
farc_cmass_sv_up1 = farc_cmass_sv,
eln_cmass_up1 = eln_cmass,
eln_cmass_sv_up1 = eln_cmass_sv,
reb_cdv_up1 = reb_cdv,
reb_cdv_sv_up1 = reb_cdv_sv,
farc_cdv_up1 = farc_cdv,
farc_cdv_sv_up1 = farc_cdv_sv,
eln_cdv_up1 = eln_cdv,
eln_cdv_sv_up1 = eln_cdv_sv)
View(m_data_f)
m_data_f <- m_data_f %>%
mutate_at(vars(reb_ckill_up1:eln_cdv_sv_up1)
, ~replace_na(., 0))
m_data_f <- m_data_f %>%
mutate(dv4b.1.1.reb_ckill_up1_r = (reb_ckill_up1/updated_pop)*100000,
dv4b.2.1.farc_ckill_up1_r = (farc_ckill_up1/updated_pop)*100000,
dv4b.3.1.eln_ckill_up1_r = (eln_ckill_up1/updated_pop)*100000
)
View(cv)
library(tidyverse)
library(readstata13)
library(foreign)
library(readxl)
library(writexl)
library(lubridate)
library(PanelMatch)
setwd("/Volumes/Backup Plus/Storage-OrganizedFiles/Article1-ReplicationMaterials_FullReplication/4.Diagnostics")
load("OMC-ResultsMainModel_Updated.RData")
pdf(file = "Figure9.1-P.pdf",   # The directory you want to save the file in
width = 13, # The width of the plot in inches
height = 3)
par(mar = c(1.5, 2, 2 , 1), oma = c(4, 4,1.5, 0))
par(mfrow = c(1, 6))
coba_pm.none5 <- get_covariate_balance(pm.maha5b.p$att,
data = data_final,
use.equal.weights = TRUE,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.maha5b.p <- get_covariate_balance(pm.maha5b.p$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.ps.m5.p <- get_covariate_balance(pm.ps.m5.p$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.ps.w5.p <- get_covariate_balance(pm.ps.w5.p$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.CBPSm5.p <- get_covariate_balance(pm.CBPSm5.p$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.CBPSw5.p <- get_covariate_balance(pm.CBPSw5.p$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
mtext("Before\nRefinement", line = -1.8, at = 0.09, outer = TRUE, cex = 1)
mtext("Mahalanobis", line = -0.2, at = 0.26, outer = TRUE, cex = 1)
mtext("PS \n Matching", line = -1.8, at = 0.42, outer = TRUE, cex = 1)
mtext("PS \n Weighting", line = -1.8, at = 0.59, outer = TRUE, cex = 1)
mtext("CBPS \n Matching", line = -1.8, at = 0.75, outer = TRUE, cex = 1)
mtext("CBPS \n Weighting", line = -1.8, at = 0.92, outer = TRUE, cex = 1)
mtext("Standarized Mean\nDifferences for Protest", side = 2, line = .3, at = 0.5,
outer = TRUE, cex = 1)
mtext(1, text = "Years relative to the administration of treatment", line = 1.2,
at = 0.5, outer = TRUE, cex = 1)
dev.off()
################################################################
# VSP
################################################################
pdf(file = "Figure9.1-V.pdf",
width = 13, # The width of the plot in inches
height = 3)
par(mar = c(1.5, 2, 2 , 1), oma = c(4, 4,1.5, 0))
par(mfrow = c(1, 6))
coba_pm.none5.v <- get_covariate_balance(pm.maha5b.v$att,
data = data_final,
use.equal.weights = TRUE,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.maha5b.v <- get_covariate_balance(pm.maha5b.v$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.ps.m5.v <- get_covariate_balance(pm.ps.m5.v$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.ps.w5.v <- get_covariate_balance(pm.ps.w5.v$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.CBPSm5.v <- get_covariate_balance(pm.CBPSm5.v$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.CBPSw5.v <- get_covariate_balance(pm.CBPSw5.v$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
mtext("Before\nRefinement", line = -1.8, at = 0.09, outer = TRUE, cex = 1)
mtext("Mahalanobis", line = -0.2, at = 0.26, outer = TRUE, cex = 1)
mtext("PS \n Matching", line = -1.8, at = 0.42, outer = TRUE, cex = 1)
mtext("PS \n Weighting", line = -1.8, at = 0.59, outer = TRUE, cex = 1)
mtext("CBPS \n Matching", line = -1.8, at = 0.75, outer = TRUE, cex = 1)
mtext("CBPS \n Weighting", line = -1.8, at = 0.92, outer = TRUE, cex = 1)
mtext("Standarized Mean\nDifferences for VSP", side = 2, line = .3, at = 0.5,
outer = TRUE, cex = 1)
mtext(1, text = "Years relative to the administration of treatment", line = 1.2,
at = 0.5, outer = TRUE, cex = 1)
dev.off()
################################################################
# Sanctuary
################################################################
pdf(file = "Figure9.1-S.pdf",
width = 13, # The width of the plot in inches
height = 3)
par(mar = c(1.5, 2, 2 , 1), oma = c(4, 4,1.5, 0))
par(mfrow = c(1, 6))
coba_pm.none5.s <- get_covariate_balance(pm.maha5b.s$att,
data = data_final,
use.equal.weights = TRUE,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.maha5b.s <- get_covariate_balance(pm.maha5b.s$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.ps.m5.s <- get_covariate_balance(pm.ps.m5.s$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.ps.w5.s <- get_covariate_balance(pm.ps.w5.s$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.CBPSm5.s <- get_covariate_balance(pm.CBPSm5.s$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
coba_pm.CBPSw5.s <- get_covariate_balance(pm.CBPSw5.s$att,
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
plot = TRUE,
legend = F,
ylim = c(-1, 1))
mtext("Before\nRefinement", line = -1.8, at = 0.09, outer = TRUE, cex = 1)
mtext("Mahalanobis", line = -0.2, at = 0.26, outer = TRUE, cex = 1)
mtext("PS \n Matching", line = -1.8, at = 0.42, outer = TRUE, cex = 1)
mtext("PS \n Weighting", line = -1.8, at = 0.59, outer = TRUE, cex = 1)
mtext("CBPS \n Matching", line = -1.8, at = 0.75, outer = TRUE, cex = 1)
mtext("CBPS \n Weighting", line = -1.8, at = 0.92, outer = TRUE, cex = 1)
mtext("Standarized Mean\nDifferences for Sanctuary", side = 2, line = .3, at = 0.5,
outer = TRUE, cex = 1)
mtext(1, text = "Years relative to the administration of treatment", line = 1.2,
at = 0.5, outer = TRUE, cex = 1)
dev.off()
##############################################################################
### COBA 2
##############################################################################
################################################################
# Protest 2
################################################################
pdf(file = "Figure9.2-P.pdf",   # The directory you want to save the file in
width = 13, # The width of the plot in inches
height = 3)
par(mar = c(1.5, 2, 2 , 1), oma = c(4, 4,1.5, 0))
par(mfrow = c(1, 5))
bscat_pm.5.p_maha.b <- balance_scatter(non_refined_set = pm.none5.p$att,
matched_set_list = list(pm.maha5b.p$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.p_ps_m <- balance_scatter(non_refined_set = pm.none5.p$att,
matched_set_list = list(pm.ps.m5.p$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.p_ps_w <- balance_scatter(non_refined_set = pm.none5.p$att,
matched_set_list = list(pm.ps.w5.p$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.p_cbps_m <- balance_scatter(non_refined_set = pm.none5.p$att,
matched_set_list = list(pm.CBPSm5.p$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.p_cbps_w <- balance_scatter(non_refined_set = pm.none5.p$att,
matched_set_list = list(pm.CBPSw5.p$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.2.no_p_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
mtext("Mahalanobis", line = -0.2, at = 0.11, outer = TRUE, cex = 1)
mtext("PS \n Matching", line = -1.8, at = 0.31, outer = TRUE, cex = 1)
mtext("PS \n Weighting", line = -1.8, at = 0.51, outer = TRUE, cex = 1)
mtext("CBPS \n Matching", line = -1.8, at = 0.71, outer = TRUE, cex = 1)
mtext("CBPS \n Weighting", line = -1.8, at = 0.91, outer = TRUE, cex = 1)
mtext("Standarized Mean\nDifferences After Refinement", side = 2, line = .3, at = 0.5,
outer = TRUE, cex = 1)
mtext(1, text = "Standarized Mean Differences Before Refinement", line = 1.2,
at = 0.5, outer = TRUE, cex = 1)
dev.off()
################################################################
# VSP 2
################################################################
pdf(file = "Figure9.2-V.pdf",
width = 13, # The width of the plot in inches
height = 3)
par(mar = c(1.5, 2, 2 , 1), oma = c(4, 4,1.5, 0))
par(mfrow = c(1, 5))
bscat_pm.5.v_maha.b <- balance_scatter(non_refined_set = pm.none5.v$att,
matched_set_list = list(pm.maha5b.v$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.v_ps_m <- balance_scatter(non_refined_set = pm.none5.v$att,
matched_set_list = list(pm.ps.m5.v$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.v_ps_w <- balance_scatter(non_refined_set = pm.none5.v$att,
matched_set_list = list(pm.ps.w5.v$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.v_cbps_m <- balance_scatter(non_refined_set = pm.none5.v$att,
matched_set_list = list(pm.CBPSm5.v$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.v_cbps_w <- balance_scatter(non_refined_set = pm.none5.v$att,
matched_set_list = list(pm.CBPSw5.v$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.4b.no_v_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
mtext("Mahalanobis", line = -0.2, at = 0.11, outer = TRUE, cex = 1)
mtext("PS \n Matching", line = -1.8, at = 0.31, outer = TRUE, cex = 1)
mtext("PS \n Weighting", line = -1.8, at = 0.51, outer = TRUE, cex = 1)
mtext("CBPS \n Matching", line = -1.8, at = 0.71, outer = TRUE, cex = 1)
mtext("CBPS \n Weighting", line = -1.8, at = 0.91, outer = TRUE, cex = 1)
mtext("Standarized Mean\nDifferences After Refinement", side = 2, line = .3, at = 0.5,
outer = TRUE, cex = 1)
mtext(1, text = "Standarized Mean Differences Before Refinement", line = 1.2,
at = 0.5, outer = TRUE, cex = 1)
dev.off()
################################################################
# Sanctuary 2
################################################################
pdf(file = "Figure9.2-S.pdf",
width = 13, # The width of the plot in inches
height = 3)
par(mar = c(1.5, 2, 2 , 1), oma = c(4, 4,1.5, 0))
par(mfrow = c(1, 5))
bscat_pm.5.s_maha.b <- balance_scatter(non_refined_set = pm.none5.s$att,
matched_set_list = list(pm.maha5b.s$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.s_ps_m <- balance_scatter(non_refined_set = pm.none5.s$att,
matched_set_list = list(pm.ps.m5.s$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.s_ps_w <- balance_scatter(non_refined_set = pm.none5.s$att,
matched_set_list = list(pm.ps.w5.s$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.s_cbps_m <- balance_scatter(non_refined_set = pm.none5.s$att,
matched_set_list = list(pm.CBPSm5.s$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
bscat_pm.5.s_cbps_w <- balance_scatter(non_refined_set = pm.none5.s$att,
matched_set_list = list(pm.CBPSw5.s$att),
data = data_final,
covariates = c("cv1.lpop", "cv2.rur_p", "cv3c.c_lsh1", "cv4.nbi",
"cv5c.1.bd_o", "cv6b.1.ce_o_r", "cv7b.3.pgf_cd_o_r",
"cv8.3.no_s_str", "dv4b.2.1.farc_ckill_up1_r"),
main = "")
mtext("Mahalanobis", line = -0.2, at = 0.11, outer = TRUE, cex = 1)
mtext("PS \n Matching", line = -1.8, at = 0.31, outer = TRUE, cex = 1)
mtext("PS \n Weighting", line = -1.8, at = 0.51, outer = TRUE, cex = 1)
mtext("CBPS \n Matching", line = -1.8, at = 0.71, outer = TRUE, cex = 1)
mtext("CBPS \n Weighting", line = -1.8, at = 0.91, outer = TRUE, cex = 1)
mtext("Standarized Mean\nDifferences After Refinement", side = 2, line = .3, at = 0.5,
outer = TRUE, cex = 1)
mtext(1, text = "Standarized Mean Differences Before Refinement", line = 1.2,
at = 0.5, outer = TRUE, cex = 1)
dev.off()
